import java.lang.reflect.InvocationTargetException;
/**
 * @author：刘东
 * @created: 2013-6-8 下午01:54:50 
 * @version：$Id$ 
 * @since:1.0
 * @copyright 
 *
 */

public class BeanUtils {
	public static void main(String[] args) {
		User user = new User();
		user.setAge(20);
		user.setUname("ld");
		Student stu = new Student();
		stu.setAge(30);
		stu.setName("aaa");
		try {
			org.apache.commons.beanutils.BeanUtils.copyProperties(stu, user);
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println(stu.getName() + stu.getAge());
		
	}
}
